package org.andao.security.service;

import java.util.List;
import java.util.Map;

import org.andao.core.base.service.BaseService;
import org.andao.core.dao.helper.Page;
import org.andao.core.exception.ServiceException;
import org.andao.security.model.Role;



/**
 * 系统角色服务.
 * 
 * @author Marco.hu(hzg139@163.com) 
 */
public interface RoleService extends BaseService<Role>{
		
	/**
	 * 根据角色编码查找角色对象
	 * @param rolecode
	 * @return
	 * @throws ServiceException
	 */
	Role getRoleByRolecode(String rolecode) throws ServiceException;
	
	/**
	 * 根据条件查找角色
	 * @param condition
	 * @param order
	 * @param page
	 * @return
	 * @throws ServiceException
	 */
	Page findRoleByCondition(Map<String,Object> condition, Page page) throws ServiceException;
	
	/**
	 * 批量删除
	 * @param split
	 */
	void deleteArray(String[] split)  throws ServiceException;
	
	/**
	 * 单个删除
	 * @param roleid
	 * @throws ServiceException
	 */
	void deleteRole(String roleid) throws ServiceException;
	
	//更新
	void saveOrUpdateRole(Role persistRole, List<String> resId) throws ServiceException;
	
	/**
	 * 查找角色树列表
	 * @param parentCode
	 * @return
	 * @throws ServiceException
	 */
	List<Role> findRoleTreeList(String parentCode) throws ServiceException;	
	
}
